package com.kwum.pattern.AbstractFactoryPattern;

/**
 * Description: 形状工厂
 * @author Kwum
 * @date 2017年9月18日 下午5:10:17
 * @version 1.0
 */

public class ShapeFactory extends AbstractFactory{

    @Override
    public Object getShape(Class<?extends Shape> clazz) {
        Object obj = null;

        try {
            obj = Class.forName(clazz.getName()).newInstance();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        
        return obj;
    }

    @Override
    public Object getColor(Class<? extends Color> clazz) {
        return null;
    }

}
